﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CastingWellEquipmentGUI.View.Pages
{
    /// <summary>
    /// CastingRecordPage.xaml 的交互逻辑
    /// </summary>
    public partial class CastingRecordPage : Page
    {
        public CastingRecordPage()
        {
            InitializeComponent();

        }

        public static CastingRecordPage instance;

        public static CastingRecordPage Instance
        {
            get
            {
                if (instance == null)
                {
                    Console.WriteLine("new Page1.................");
                    instance = new CastingRecordPage();
                }

                return instance;
            }
        }

        private void DataGrid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
        {
            if (e.Column.Header.ToString() == "RecipeId" ||
                e.Column.Header.ToString() == "RecipeName" ||
                e.Column.Header.ToString() == "FRN_FRNBATHTEMPHILIM" ||
                e.Column.Header.ToString() == "FRN_FRNBATHTEMPLOLIM" ||
                e.Column.Header.ToString() == "FRN_FRNBATHTEMPSP" ||
                e.Column.Header.ToString() == "FRN_FRNTILTBACKOFFSET" ||
                e.Column.Header.ToString() == "GAS_BEGINRAMPDOWN" ||
                e.Column.Header.ToString() == "GAS_ENDRAMPDOWN" ||
                e.Column.Header.ToString() == "GAS_IDLECASTGAS" ||
                e.Column.Header.ToString() == "GAS_RUNCASTGAS" ||
                e.Column.Header.ToString() == "GAS_STARTCASTGAS" ||
                e.Column.Header.ToString() == "GAS_STARTCASTGASLEN" ||
                e.Column.Header.ToString() == "JET_OFFPRESLEN" ||
                e.Column.Header.ToString() == "JET_OFFPRESLENEND" ||
                e.Column.Header.ToString() == "JET_PRES1" ||
                e.Column.Header.ToString() == "JET_PRES1END" ||
                e.Column.Header.ToString() == "JET_PRES2" ||
                e.Column.Header.ToString() == "JET_PRES2END" ||
                e.Column.Header.ToString() == "JET_PRESLEN1" ||
                e.Column.Header.ToString() == "JET_PRESLEN1END" ||
                e.Column.Header.ToString() == "JET_PRESLEN2" ||
                e.Column.Header.ToString() == "JET_PRESLEN2END" ||
                e.Column.Header.ToString() == "JET_STARTPRES" ||
                e.Column.Header.ToString() == "JET_STARTPRESEND" ||
                e.Column.Header.ToString() == "LEN_CASTLENGTH" ||
                e.Column.Header.ToString() == "LUB_LEN2" ||
                e.Column.Header.ToString() == "LUB_LEN3" ||
                e.Column.Header.ToString() == "LUB_LEN4" ||
                e.Column.Header.ToString() == "LUB_PULSELUBECYCTIME" ||
                e.Column.Header.ToString() == "LUB_PULSELUBECYCTIME2" ||
                e.Column.Header.ToString() == "LUB_PULSELUBECYCTIME3" ||
                e.Column.Header.ToString() == "LUB_PULSELUBECYCTIME4" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEOFFTIME" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEONTIME" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPRESFIRE" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPRESHOLD" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPRESRESET" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPULSES" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPULSES2" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPULSES3" ||
                e.Column.Header.ToString() == "LUB_PULSELUBEPULSES4" ||
                e.Column.Header.ToString() == "MLC_FILLRATE1" ||
                e.Column.Header.ToString() == "MLC_FILLRATE1STARTLEVEL	" ||
                e.Column.Header.ToString() == "MLC_FILLRATE2" ||
                e.Column.Header.ToString() == "MLC_FILLRATE2STARTLEVEL	" ||
                e.Column.Header.ToString() == "MLC_FILLRATE3" ||
                e.Column.Header.ToString() == "MLC_FILLRATE3STARTLEVEL	" ||
                e.Column.Header.ToString() == "MLC_FILLRATE4" ||
                e.Column.Header.ToString() == "MLC_FILLRATE4STARTLEVEL" ||
                e.Column.Header.ToString() == "MLC_FILLRATESTART" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL1" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL1LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL2" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL2LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL3" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL3LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL4" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL4LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL5" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL5LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL6" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL6LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL7" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL7LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL8" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL8LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL9" ||
                e.Column.Header.ToString() == "MLC_MOLDLVL9LEN" ||
                e.Column.Header.ToString() == "MLC_MOLDLVLSTART" ||
                e.Column.Header.ToString() == "MLC_PINPRESET1" ||
                e.Column.Header.ToString() == "MLC_PINPRESET2" ||
                e.Column.Header.ToString() == "MLC_PINPRESET3" ||
                e.Column.Header.ToString() == "MLC_PINPRESET4" ||
                e.Column.Header.ToString() == "MLC_PINPRESET5" ||
                e.Column.Header.ToString() == "MLC_PINPRESET6" ||
                e.Column.Header.ToString() == "MLC_PINPRESET7" ||
                e.Column.Header.ToString() == "MLC_PINPRESET8" ||
                e.Column.Header.ToString() == "MLC_PINPRESET9" ||
                e.Column.Header.ToString() == "MLC_PINPRESET10" ||
                e.Column.Header.ToString() == "MLC_PINPRESET11" ||
                e.Column.Header.ToString() == "MLC_PINPRESET12" ||
                e.Column.Header.ToString() == "MLC_PINPRESET13" ||
                e.Column.Header.ToString() == "MLC_PINPRESET14" ||
                e.Column.Header.ToString() == "MLC_PINPRESET15" ||
                e.Column.Header.ToString() == "MLC_UNCNTRLDFILLDIST" ||
                e.Column.Header.ToString() == "MTL_DEGASTEMP" ||
                e.Column.Header.ToString() == "ROD_RODSPEED" ||
                e.Column.Header.ToString() == "SPD_CASTSPD1" ||
                e.Column.Header.ToString() == "SPD_CASTSPD1LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD2" ||
                e.Column.Header.ToString() == "SPD_CASTSPD2LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD3" ||
                e.Column.Header.ToString() == "SPD_CASTSPD3LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD4" ||
                e.Column.Header.ToString() == "SPD_CASTSPD4LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD5" ||
                e.Column.Header.ToString() == "SPD_CASTSPD5LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD6" ||
                e.Column.Header.ToString() == "SPD_CASTSPD6LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD7" ||
                e.Column.Header.ToString() == "SPD_CASTSPD7LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD8" ||
                e.Column.Header.ToString() == "SPD_CASTSPD8LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPD9" ||
                e.Column.Header.ToString() == "SPD_CASTSPD9LEN" ||
                e.Column.Header.ToString() == "SPD_CASTSPDEND" ||
                e.Column.Header.ToString() == "SPD_CASTSPDSTART" ||
                e.Column.Header.ToString() == "SPD_PLTNHOLDTIME" ||
                e.Column.Header.ToString() == "TGH_DAMPULLSP1" ||
                e.Column.Header.ToString() == "TGH_DAMPULLSP2" ||
                e.Column.Header.ToString() == "TGH_TROUGHTEMP" ||
                e.Column.Header.ToString() == "WIP_WiperOnLen" ||
                e.Column.Header.ToString() == "WIP_WiperPosition" ||
                e.Column.Header.ToString() == "WIP_WIPPOS1" ||
                e.Column.Header.ToString() == "WIP_WIPPOS1LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS2" ||
                e.Column.Header.ToString() == "WIP_WIPPOS2LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS3" ||
                e.Column.Header.ToString() == "WIP_WIPPOS3LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS4" ||
                e.Column.Header.ToString() == "WIP_WIPPOS4LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS5" ||
                e.Column.Header.ToString() == "WIP_WIPPOS5LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS6" ||
                e.Column.Header.ToString() == "WIP_WIPPOS6LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS7" ||
                e.Column.Header.ToString() == "WIP_WIPPOS7LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS8" ||
                e.Column.Header.ToString() == "WIP_WIPPOS8LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOS9" ||
                e.Column.Header.ToString() == "WIP_WIPPOS9LEN" ||
                e.Column.Header.ToString() == "WIP_WIPPOSEND" ||
                e.Column.Header.ToString() == "WIP_WIPPOSSTART" ||
                e.Column.Header.ToString() == "WTR_WATEROFFDELAY" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW1" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW1LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW2" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW2LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW3" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW3LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW4" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW4LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW5" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW5LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW6" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW6LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW7" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW7LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW8" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW8LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW9" ||
                e.Column.Header.ToString() == "WTR_WTRFLOW9LEN" ||
                e.Column.Header.ToString() == "WTR_WTRFLOWEND" ||
                e.Column.Header.ToString() == "WTR_WTRFLOWSTART" ||
                e.Column.Header.ToString() == "WTR_WTRTEMPHILIMIT" ||
                e.Column.Header.ToString() == "WTR_WTRTEMPLOLIMIT" ||
                e.Column.Header.ToString() == "MSC_COOLDOWNTIME" ||
                e.Column.Header.ToString() == "MSC_MOLDDIAMETER" ||
                e.Column.Header.ToString() == "MSC_MOLDHEIGHT" ||
                e.Column.Header.ToString() == "MSC_MOLDTHICKNESS" ||
                e.Column.Header.ToString() == "MSC_MOLDWIDTH" ||
                e.Column.Header.ToString() == "MSC_RECNAME" ||
                e.Column.Header.ToString() == "MSC_NUMBERMOLDS" ||
                e.Column.Header.ToString() == "MSC_REV" ||
                e.Column.Header.ToString() == "MSC_UserDef1" ||
                e.Column.Header.ToString() == "MSC_UserDef2" ||
                e.Column.Header.ToString() == "MSC_UserDef3" ||
                e.Column.Header.ToString() == "MSC_UserDef4" ||
                e.Column.Header.ToString() == "MSC_UserDef5" ||
                e.Column.Header.ToString() == "MSC_UserDef6" ||
                e.Column.Header.ToString() == "MSC_UserDef7" ||
                e.Column.Header.ToString() == "MSC_UserDef8" ||
                e.Column.Header.ToString() == "MSC_UserDef9" ||
                e.Column.Header.ToString() == "MSC_UserDef10" ||
                e.Column.Header.ToString() == "MSC_Description" ||
                e.Column.Header.ToString() == "MSC_Alloy" ||
                e.Column.Header.ToString() == "MSC_MoldTech" ||
                e.Column.Header.ToString() == "MSC_DateCreated" ||
                e.Column.Header.ToString() == "MSC_DateLastUsed" ||
                e.Column.Header.ToString() == "MSC_CreatedBy" ||
                e.Column.Header.ToString() == "MSC_DateCreated_Start" ||
                e.Column.Header.ToString() == "MSC_DateCreated_End" ||
                e.Column.Header.ToString() == "MSC_DateCreater" ||
                e.Column.Header.ToString() == "OrderNo" ||
                e.Column.Header.ToString() == "MSC_DateCreatedStr" ||
                e.Column.Header.ToString() == "MSC_DateLastUsedStr" ||
                e.Column.Header.ToString() == "MSC_Creater" ||
                e.Column.Header.ToString() == "MLC_FILLRATE1STARTLEVEL" ||
                e.Column.Header.ToString() == "MLC_FILLRATE2STARTLEVEL" ||
                e.Column.Header.ToString() == "MLC_FILLRATE3STARTLEVEL" ||
                e.Column.Header.ToString() == "MSC_REVStr" ||
                e.Column.Header.ToString() == "MSC_MOLDDIAMETERStr" ||
                e.Column.Header.ToString() == "CastNumber" ||
                e.Column.Header.ToString() == "CastId" ||
                e.Column.Header.ToString() == "CastStartTime" ||
                e.Column.Header.ToString() == "CastStartTimeStr" ||
                e.Column.Header.ToString() == "CastStopTime" ||
                e.Column.Header.ToString() == "CastStopTimeStr" ||
                e.Column.Header.ToString() == "RepiceName" ||
                e.Column.Header.ToString() == "RepiceRevName" ||
                e.Column.Header.ToString() == "MSC_Type" ||
                e.Column.Header.ToString() == "RecipeNameStr"
               )
            {
                e.Cancel = true;
            }
        }
    }
}
